﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Views/Admin.master" AutoEventWireup="true"
    CodeFile="ManuFacture.aspx.cs" Inherits="Admin_ManuFacture" %>

<%@ Register TagPrefix="tpxMenu" TagName="Menu" Src="~/Admin/Views/common/menu.ascx"
    runat="Server" %>
<asp:Content ID="Content1" ContentPlaceHolderID="menu" runat="Server">
    <tpxMenu:Menu ID="Menu1" runat="Server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="home" runat="Server">
    <script>

        function confirm_delete() {
            if (confirm("Are you sure you want to delete ?") == true)
                return true;
            else
                return false;
        }
    </script>
    <form id="form1" runat="server">
    <div class="box">
        <div class="left">
        </div>
        <div class="right">
        </div>
        <div class="heading">
            <h1 style="background-image: url('Views/Image/user.png');">
               Management Manufacture</h1>
        </div>
        <div class="content">
            <asp:DataList ID="dlManuFac" runat="server" Width="946px" DataKeyField="manufacturer_id"
                OnUpdateCommand="dlManuFac_UpdateCommand" OnDeleteCommand="dlManuFac_DeleteCommand"
                OnEditCommand="dlManuFac_EditCommand">
                <EditItemTemplate>
                    <table style="width: 100%;" >
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label1" runat="server" Text="Name ManuFacture :"></asp:Label>
                            </td>
                            <td class="style5">
                                <asp:TextBox ID="txtNameManu" runat="server" Text='<%# Eval("name") %>'></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="style6">
                                <asp:Label ID="Label5" runat="server" Text="Image :"></asp:Label>
                            </td>
                            <td class="style5" align="justify" valign="middle">
                                <asp:Image ID="Image" runat="server" Height="92px" Width="115px" ImageUrl='<%# Eval("image") %>' />
                                &nbsp;<asp:FileUpload ID="fileUpload" runat="server" />
                                <br />
                                <asp:Label ID="lblFileInfo" runat="server" Text='<%# Eval("image") %>'></asp:Label>
                                <br />
                                <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Upload" />
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">
                                <asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" CommandName="Update" />
                                &nbsp;<asp:Button ID="Button3" runat="server" OnClick="Button3_Click" Text="Cancel" />
                            </td>
                        </tr>
                    </table>
                </EditItemTemplate>
                <HeaderTemplate>
                    <table style="width: 100%;" align="center" border="1px solid black" cellpadding="0" cellspacing="0">
                        <tr bgcolor="#00CCFF">
                            <th align="center" class="style3">
                                Action
                            </th>
                            <th align="center">
                                Manufacture name
                            </th>
                            <th align="center">
                                Img
                            </th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td style="text-align: center">
                            <asp:ImageButton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton"
                                CommandName="Edit" Text="Edit" runat="server" />
                            &nbsp;
                            <asp:ImageButton AlternateText="Delete" ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton"
                                CommandName="Delete" Text="Delete" runat="server" OnClientClick="return confirm_delete();" />
                        </td>
                        <td style="text-align: center">
                            <%# Eval("name")%>
                        </td>
                        <td style="text-align: center">
                           <%# Eval("image") %>' 
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:DataList>
            </table>
        </div>
    </div>
    </form>
</asp:Content>
